package com.prince.enums;

import com.prince.entity.TagItemSimpleVo;

import java.util.ArrayList;
import java.util.List;

public enum PayTypeEnum {

    /** 支付状态 */
    WECHAT(1, "微信"),
    ALI(2, "支付宝"),
    UNIONPAY(3, "银联"),
    CASH(4,"现金"),
    AMOUNT(5,"账户");

    private Integer code;
    private String name;

    PayTypeEnum(Integer code , String name){
        this.code = code;
        this.name = name;
    }
    public Integer getCode(){
        return code;
    }
    public String getName(){
        return name;
    }
    /**
     * 获取支付渠道名称
     * @return String
     */
    public static List<TagItemSimpleVo> getListData(){
        List<TagItemSimpleVo> list = new ArrayList<>();
        for (PayTypeEnum value : values()) {
            list.add(new TagItemSimpleVo(String.valueOf(value.getCode()),value.getName()));
        }
        return list;
    }
}
